Skip to content

TST: Make old tests more performant #55746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Oct 29, 2023
Merged

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke commented Oct 28, 2023

  • Use less data to test the same behavior
  • Parameterize test for loops

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Oct 28, 2023
@pytest.mark.slow
@pytest.mark.parametrize("df, keys, bins, n, m", binned, ids=ids)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

expected = DataFrame({"x": range(10**6 + 1)}, dtype="int64")
size_cutoff = 50
with monkeypatch.context():
monkeypatch.setattr(libindex, "_SIZE_CUTOFF", size_cutoff)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm looking at this id actually expect us to cdef _SIZE_CUTOFF for a tiny perf boost. no harm in doing this until then i guess

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as there's an accessible Python version to override this too, SGTM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think they're mutually exclusive, but im fine with doing this for the short-to-medium term

@mroeschke mroeschke added this to the 2.2 milestone Oct 29, 2023
@mroeschke
Copy link
Member Author

Looks like tests are passing here so going to merge

@mroeschke mroeschke merged commit adae693 into pandas-dev:main Oct 29, 2023
@mroeschke mroeschke deleted the tst/perfs branch October 29, 2023 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants